<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<form name = "form1">
			
			<input type="text" name="username" value="张三"/>
		</form>
		<button onclick="add()">添加</button>
		
		<script type="text/javascript">
			function add()
			{
				var txt = document.createElement("input");
				txt.type = "text";
				txt.name = "nickname";
				txt.value = "小张";
				
				document.form1.appendChild(txt);
				
			}
		</script>
	</body>
</html>
